package chapterSystem.client.model.enums;

/**
 * User: Svetlana Zemlyanskaya(svetazem@yandex-team.ru)
 * Date: 4/14/12
 */
public enum ActivityType {
    MAIN(1),
    ORDERS(2),
    REPORT(3),
    UNIT(4),
    EVENT(5),
    NEW_BROTHER(6),
    WRITE_EXECUTION(7),
    EDIT_ORDER(8),
    EDIT_EXECUTION(9),
    WRITE_ORDER(10),
    EDIT_BROTHER(11);

    private int id;

    ActivityType(final int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public static ActivityType byCode(final int code) {
        for (final ActivityType type : ActivityType.values()) {
            if (type.id == code) {
                return type;
            }
        }
        return ActivityType.MAIN;
    }
}
